package dubbo.server4.impl.mq;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

import dubbo.server4.api.TestService4;

@Service
public class ConsumerListener {
	private static final Logger logger = Logger.getLogger(ConsumerListener.class);
	@Autowired
	private TestService4 testService4;

	@JmsListener(destination = "mytest.queue")
	public void receiveQueue(String text) {
		logger.info("Consumer收到的报文为:" + text);
        try {
        	testService4.DealMQ(text);
		} catch (Exception e) {
			logger.error("ConsumerListener.receiveQueue处理异常：",e);
		}
	}
}
